package jyc_util.a_review.count_down_latch;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

/**
 * @author haomin
 * @date 2022/09/23 18:16
 **/
public class Main {
    static CountDownLatch countDownLatch = new CountDownLatch(3);
    static class MyThread extends Thread{
        @Override
        public void run() {
            try {
                TimeUnit.SECONDS.sleep(5);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            countDownLatch.countDown();
            countDownLatch.countDown();
            countDownLatch.countDown();
        }
    }

    public static void main(String[] args) throws InterruptedException {
        MyThread t = new MyThread();
        t.start();
        countDownLatch.await();
        System.out.println("cd完了");

    }
}